home *** CD-ROM | disk | FTP | other *** search
- // This is a part of the Microsoft Foundation Classes C++ library.
- // Copyright (C) 1992-1998 Microsoft Corporation
- // All rights reserved.
- //
- // This source code is only intended as a supplement to the
- // Microsoft Foundation Classes Reference and related
- // electronic documentation provided with the library.
- // See these sources for detailed information regarding the
- // Microsoft Foundation Classes product.
-
- #ifndef __WCEALT_INL__
- #define __WCEALT_INL__
-
- inline BOOL wce_LockWindowUpdate(HWND hWnd)
- {
- return TRUE;
- }
-
- inline UINT wce_IsDlgButtonChecked(HWND hDlg, int nIDButton)
- {
- return (UINT)::SendMessage(::GetDlgItem(hDlg, nIDButton), BM_GETCHECK, 0L, 0L);
- }
-
- inline BOOL wce_SetDlgItemText(HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
- {
- return ::SetWindowText(GetDlgItem(hDlg,nIDDlgItem),lpString);
- }
-
- inline LONG wce_SendDlgItemMessage(HWND hDlg, int nIDDlgItem, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- return (long)SendMessage(GetDlgItem(hDlg, nIDDlgItem), uMsg, wParam, lParam);
- }
-
- inline UINT wce_GetDlgItemText(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
- {
- return ::GetWindowText(GetDlgItem(hDlg, nIDDlgItem), lpString, nMaxCount);
- }
-
- inline void wce_CheckDlgButton(HWND hDlg, int nIDButton, UINT uCheck)
- {
- ::SendMessage(::GetDlgItem(hDlg, nIDButton), BM_SETCHECK, uCheck, 0);
- }
-
- inline BOOL wce_IsIconic(HWND hWnd)
- {
- return !IsWindowEnabled(hWnd);
- }
-
- inline HWND wce_GetTopWindow(HWND hWnd)
- {
- return ::GetWindow(hWnd, GW_CHILD);
- }
-
- inline HWND wce_GetNextWindow(HWND hWnd, UINT nDirection)
- {
- return ::GetWindow(hWnd, nDirection);
- }
-
- inline HWND wce_GetDesktopWindow()
- {
- return HWND_DESKTOP;
- }
-
- inline HWND wce_GetLastActivePopup(HWND hWnd)
- {
- return ::GetActiveWindow();
- }
-
- inline BOOL wce_ScrollWindow(HWND hWnd, int xAmount, int yAmount, LPCRECT lpRect, LPCRECT lpClipRect)
- {
- return (ERROR != ::ScrollWindowEx(hWnd, xAmount, yAmount, lpRect, lpClipRect,
- NULL, NULL, SW_INVALIDATE | SW_ERASE));
- }
-
- inline BOOL wce_IsMenu(HMENU hMenu)
- {
- MENUITEMINFO mii;
- memset((char*)&mii, 0, sizeof(MENUITEMINFO));
- mii.cbSize = sizeof(MENUITEMINFO);
- if (GetMenuItemInfo(hMenu, 0, TRUE, &mii))
- return TRUE;
- else
- return (GetLastError() == 0);
- }
-
- inline BOOL wce_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, CONST RECT *prcRect)
- {
- return(::TrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, NULL));
- }
-
- inline BOOL wce_InvertRect(HDC hdc, const RECT* lprc)
- {
- return ::PatBlt(hdc, lprc->left, lprc->top,
- lprc->right - lprc->left,
- lprc->bottom - lprc->top, DSTINVERT);
- }
-
- inline int wce_GetMapMode(HDC hdc)
- {
- if (hdc == NULL)
- return 0;
- return MM_TEXT; // the only mapping mode
- }
-
- inline BOOL wce_GetViewportOrgEx(HDC hdc, LPPOINT lpPoint)
- {
- if (hdc == NULL)
- return FALSE;
- lpPoint->x = 0; // origin is always (0,0)
- lpPoint->y = 0;
- return TRUE;
- }
-
- inline BOOL wce_GetViewportExtEx(HDC hdc, LPSIZE lpSize)
- {
- if (hdc == NULL)
- return FALSE;
- lpSize->cx = 1; // extent is always 1,1
- lpSize->cy = 1;
- return TRUE;
- }
-
- inline BOOL wce_GetWindowOrgEx(HDC hdc, LPPOINT lpPoint)
- {
- if (hdc == NULL)
- return FALSE;
- lpPoint->x = 0; // origin is always (0,0)
- lpPoint->y = 0;
- return TRUE;
- }
-
- inline BOOL wce_GetWindowExtEx(HDC hdc, LPSIZE lpSize)
- {
- if (hdc == NULL)
- return FALSE;
- lpSize->cx = 1; // extent is always 1,1
- lpSize->cy = 1;
- return TRUE;
- }
-
- inline BOOL wce_DPtoLP(HDC hdc, LPPOINT lpPoints, int nCount)
- {
- if (hdc == NULL)
- return FALSE;
- return TRUE; // DP = LP always
- }
-
- inline BOOL wce_LPtoDP(HDC hdc, LPPOINT lpPoints, int nCount)
- {
- if (hdc == NULL)
- return FALSE;
- return TRUE; // DP = LP always
- }
-
- inline BOOL wce_DrawIcon(HDC hDC, int X, int Y, HICON hIcon)
- {
- return ::DrawIconEx(hDC, X, Y, hIcon, 0, 0, 0,NULL, DI_NORMAL);
- }
-
- inline HCURSOR wce_LoadCursor(HINSTANCE hInstance,LPCWSTR lpCursorName)
- {
- return ::LoadCursorW(hInstance, lpCursorName);
- }
-
- inline HBITMAP wce_CreateBitmapIndirect(LPBITMAP lpBitmap)
- {
- return ::CreateBitmap(lpBitmap->bmWidth,
- lpBitmap->bmHeight,
- lpBitmap->bmPlanes,
- lpBitmap->bmBitsPixel,
- lpBitmap->bmBits);
- }
-
- #endif // __WCEALT_INL__
-